home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / WINDING.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-29  |  5.4 KB  |  179 lines

  1. 10  'WINDING - 03 FEB 90 rev. 28 SEP 96
  2. 20  IF EX$=""THEN EX$="EXIT"
  3. 30  CLS:KEY OFF
  4. 40  COLOR 7,0,1
  5. 50  DIM AWG(40,2)
  6. 60  U3$="####.###"
  7. 70  UL$=STRING$(80,205)
  8. 80  ER$=STRING$(80,32)
  9. 90  PI=3.14159
  10. 100  X=96        'chr$ counter
  11. 110  '
  12. 120  '.....wire diameter
  13. 130  DATA .2893,.2576,.2294,.2043,.1819,.1620,.1443,.1285,.1144,.1019
  14. 140  DATA .0907,.0808,.0720,.0641,.0571,.0508,.0453,.0403,.0359,.0320
  15. 150  DATA .0285,.0253,.0226,.0201,.0179,.0159,.0142,.0126,.0113,.0100
  16. 160  DATA .00893,.00795,.00708,.00630,.00561,.005,.00445,.00396,.00353,.00314
  17. 170  FOR Z=1 TO 40:READ AWG(Z,1):NEXT Z
  18. 180  '
  19. 190  '.....ohms per 1000 ft.
  20. 200  DATA .1264,.1593,.2009,.2533,.3195,.4028,.5080,.6405,.8077,1.018
  21. 210  DATA 1.284,1.619,2.042,2.575,3.247,4.094,5.163,6.510,8.210,10.35
  22. 220  DATA 13.05,16.46,20.76,26.17,33.00,41.62,52.48,66.17,83.44,105.2
  23. 230  DATA 132.7,167.3,211.0,266.0,335.0,423.0,533.0,673.0,848.0,1070
  24. 240  DATA 41.62,66.17,105.2,167.3,266,423,673,1070
  25. 250  FOR Z=1 TO 40:READ AWG(Z,2):NEXT Z
  26. 260  '
  27. 270  T$=" POWER TRANSFORMER WINDINGS"+STRING$(29,32)+"by GEORGE MURPHY VE3ERP "
  28. 280  '
  29. 290  '.....start
  30. 300  CLS
  31. 310  COLOR 15,2
  32. 320  PRINT T$;
  33. 330  COLOR 1,0:PRINT STRING$(80,223);
  34. 340  COLOR 7,0
  35. 350  GOSUB 1240      'print text
  36. 360  COLOR 0,7:LOCATE 25,22
  37. 370  PRINT " Press 1 to continue or 0 to EXIT.....";
  38. 380  COLOR 7,0
  39. 390  Z$=INKEY$:IF Z$=""THEN 390
  40. 400  IF Z$="0"THEN CLS:RUN EX$
  41. 410  IF Z$="1"THEN 430
  42. 420  GOTO 390
  43. 430  GOSUB 1660      'screen dump
  44. 440  '
  45. 450  '.....start
  46. 460  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  47. 470  '.....input voltages
  48. 480  INPUT " ENTER: Voltage of High Voltage winding.....................";HV
  49. 490  IF HV=0 THEN LOCATE CSRLIN-1:GOTO 480
  50. 500  LOCATE CSRLIN-1:PRINT STRING$(7,32)
  51. 510  LOCATE CSRLIN-1,61:PRINT USING U3$;HV;:PRINT " volts"
  52. 520  INPUT " ENTER: Voltage of Low Voltage winding......................";LV
  53. 530  IF LV=0 THEN LOCATE CSRLIN-1:GOTO 520
  54. 540  LOCATE CSRLIN-1:PRINT STRING$(7,32)
  55. 550  LOCATE CSRLIN-1,61:PRINT USING U3$;LV;:PRINT " volts"
  56. 560  HL=HV/LV                  'HL=ratio
  57. 570  PRINT TAB(9);"Turns ratio................................................"
  58. 580  LOCATE CSRLIN-1:PRINT STRING$(7,32)
  59. 590  LOCATE CSRLIN-1,61:PRINT USING U3$;HL;:PRINT " : 1"
  60. 600  INPUT " ENTER: Measured diameter of wire in High Voltage Winding...";W
  61. 610  LOCATE CSRLIN-1:PRINT STRING$(7,32)
  62. 620  LOCATE CSRLIN-1,61:PRINT USING U3$;W;:PRINT " inches"
  63. 630  FOR Z=40 TO 1 STEP-1
  64. 640  IF AWG(Z,1)>=W THEN GA=Z:GOTO 660
  65. 650  NEXT Z
  66. 660  GOSUB 730
  67. 670  FOR Z=1 TO 40
  68. 680  IF AWG(Z,1)<=W THEN GA=Z:GOTO 700
  69. 690  NEXT Z
  70. 700  GOSUB 730
  71. 710  GOTO 830
  72. 720  '
  73. 730  '.....display
  74. 740  X=X+1     'chr$ counter
  75. 750  GA(X-96)=GA
  76. 760  PRINT "   (";CHR$(X);")  ";
  77. 770  PRINT "AWG";USING "###";GA;
  78. 780  DI=AWG(GA,1)
  79. 790  PRINT " is ";USING ".####";DI;
  80. 800  PRINT CHR$(34);" dia."
  81. 810  RETURN
  82. 820  '
  83. 830  PRINT " Press letter in ( ) to select probable actual gauge of wire..."
  84. 840  Z$=INKEY$
  85. 850  IF Z$="a"OR Z$="A"THEN GA=GA(1):GOTO 880
  86. 860  IF Z$="b"OR Z$="B"THEN GA=GA(2):GOTO 880
  87. 870  GOTO 840
  88. 880  LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1
  89. 890  FOR Z=CSRLIN-2 TO CSRLIN-1:LOCATE Z:PRINT STRING$(6,32):NEXT Z
  90. 900  PRINT TAB(9);"The gauge of wire is probably AWG";GA
  91. 910  PRINT TAB(9);"AWG";GA;"copper wire resistance......................";
  92. 920  PRINT TAB(61);USING U3$;AWG(GA,2);:PRINT " ohms/M ft."
  93. 930  CM=(AWG(GA,1)*1000)^2              'circular mils
  94. 940  CAP=CM/700                         'capacity @ 700 CM/amp
  95. 950  VA=HV*CAP
  96. 960  PRINT TAB(8);" Approximate volt/ampere rating..........................."
  97. 970  LOCATE CSRLIN-1,61:PRINT USING "####.#";VA;:PRINT "   VA."
  98. 980  '
  99. 990  INPUT " ENTER: Measured resistance of High Voltage winding...(ohms)";RH
  100. 1000  LOCATE CSRLIN-1:PRINT STRING$(7,32)
  101. 1010  LOCATE CSRLIN-1,61:PRINT USING U3$;RH;:PRINT " ohms"
  102. 1020  PRINT UL$;
  103. 1030  LH=1000/AWG(GA,2)*RH*12
  104. 1040  PRINT " HIGH VOLTAGE WINDING: Estimated length of wire..................."
  105. 1050  LOCATE CSRLIN-1,61:PRINT USING U3$;LH;:PRINT " inches"
  106. 1060  PRINT TAB(60);"=";USING U3$;LH/12;:PRINT " feet
  107. 1070  PRINT TAB(23);"Current capacity @ 700 circ.mils/amp =";
  108. 1080  PRINT USING U3$;CAP;:PRINT " amps"
  109. 1090  PRINT TAB(44);"Inches per volt =";USING U3$;LH/HV;:PRINT " inches"
  110. 1100  PRINT UL$;
  111. 1110  LL=LH/HL
  112. 1120  PRINT " LOW VOLTAGE WINDING: Estimated length of wire...................."
  113. 1130  LOCATE CSRLIN-1,61:PRINT USING U3$;LL;:PRINT " inches"
  114. 1140  PRINT TAB(60);"=";USING U3$;LL/12;:PRINT " feet
  115. 1150  CAP=CAP*HL
  116. 1160  PRINT TAB(23);"Current capacity @ 700 circ.mils/amp =";
  117. 1170  PRINT USING U3$;CAP;:PRINT " amps"
  118. 1180  PRINT TAB(44);"Inches per volt =";USING U3$;LL/LV;:PRINT " inches"
  119. 1190  PRINT UL$;
  120. 1200  GOSUB 1660
  121. 1210  GOTO 290   'start
  122. 1220  END
  123. 1230  '
  124. 1240  '.....text block
  125. 1250  TB=7     'tab for text
  126. 1260  PRINT TAB(TB);
  127. 1270  PRINT "This program estimates the lengths of transformer windings. To use"
  128. 1280  PRINT TAB(TB);
  129. 1290  PRINT "the program you will need two precision instruments:"
  130. 1300  PRINT
  131. 1310  PRINT TAB(TB);
  132. 1320  PRINT "  - a micrometer or vernier caliper capable of measuring wire"
  133. 1330  PRINT TAB(TB);
  134. 1340  PRINT "diameters to within .001 in. accuracy....."
  135. 1350  PRINT
  136. 1360  PRINT TAB(TB);
  137. 1370  PRINT "  - a high quality digital ohmeter capable of measuring resistances"
  138. 1380  PRINT TAB(TB);
  139. 1390  PRINT "of less than 1- to two or three decimal places....."
  140. 1400  PRINT
  141. 1410  PRINT TAB(TB);
  142. 1420  PRINT "You can check your meter by measuring the resistance of a long"
  143. 1430  PRINT TAB(TB);
  144. 1440  PRINT "length of wire and, by using the HAMCALC copper wire programs,"
  145. 1450  PRINT TAB(TB);
  146. 1460  PRINT "calculate what the resistance should be. For instance, the #14"
  147. 1470  PRINT TAB(TB);
  148. 1480  PRINT "conductors in a 50 metre spool of house wiring at your local"
  149. 1490  PRINT TAB(TB);
  150. 1500  PRINT "builders' supply store should have a resistance of 0.42 ohms."
  151. 1510  PRINT
  152. 1520  PRINT TAB(TB);
  153. 1530  PRINT "The program assumes the length of one turn of wire to be the same"
  154. 1540  PRINT TAB(TB);
  155. 1550  PRINT "for both windings and all turns contain the same length of wire."
  156. 1560  PRINT TAB(TB);
  157. 1570  PRINT "This is rarely the actual case, therefore the calculations made by"
  158. 1580  PRINT TAB(TB);
  159. 1590  PRINT "the program must be considered as approximate only, but adequate"
  160. 1600  PRINT TAB(TB);
  161. 1610  PRINT "enough to affect your decision whether or not to open up the"
  162. 1620  PRINT TAB(TB);
  163. 1630  PRINT "transformer to see what is REALLY inside !"
  164. 1640  RETURN
  165. 1650  '
  166. 1660  'HARDCOPY
  167. 1670  GOSUB 1780:LOCATE 25,2:COLOR 14,6
  168. 1680  PRINT " Press 1 to print screen, 2 to print screen & ";
  169. 1690  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  170. 1700  Z$=INKEY$:IF Z$="3"THEN GOSUB 1780:RETURN
  171. 1710  IF Z$="1"OR Z$="2"THEN GOSUB 1780:GOTO 1730
  172. 1720  GOTO 1700
  173. 1730  FOR QX=1 TO 24:FOR QY=1 TO 80
  174. 1740  LPRINT CHR$(SCREEN(QX,QY));
  175. 1750  NEXT QY:NEXT QX
  176. 1760  IF Z$="2"THEN LPRINT CHR$(12)
  177. 1770  GOTO 1670
  178. 1780  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  179.